/**
 * Created by lixinkun on 2017/4/21.
 */
'use strict';

//这个是内部使用的方法
function convertTime(time) {
    if (time < 9){
        return '0' + time;
    }
    return time;
}

export function getCurrentDate() {
    var date = new Date();
    return date.getFullYear() + '/' + convertTime(date.getMonth() + 1)
        + '/' + convertTime(date.getDate());
}

export function getYesterdayFromDate(date) {
    var date = new Date(date);
    date.setDate(date.getDate() - 1);
    return date.getFullYear() + '/' + convertTime(date.getMonth() + 1)
        + '/' + convertTime(date.getDate());
}